Skip to content

fix: ContainerTransferTask crash when transferring 0-count selection#292

Open
we-02 wants to merge 1 commit into
lambda-client:1.21.11from
we-02:fix/container-transfer-zero-count-crash
Open

fix: ContainerTransferTask crash when transferring 0-count selection#292
we-02 wants to merge 1 commit into
lambda-client:1.21.11from
we-02:fix/container-transfer-zero-count-crash

Conversation

@we-02
Copy link
Copy Markdown

@we-02 we-02 commented May 12, 2026

Fixes #226

BreakSim creates a StackSelection with count=0 to represent an empty
hand being acceptable. When the build engine resolved a WrongItemSelection
result with this selection, it unconditionally called transferByTask,
spawning a ContainerTransferTask that tried to move 0 items out of a
shulker box  which always failed with NoMaterialAccessException.

Two fixes:
- GenericResult.WrongItemSelection.resolve(): skip the transfer when
  count == 0, since nothing needs to be acquired.
- ContainerTransferTask.checkFail(): was calling failure() unconditionally
  via �lso {}, making failIfNoMaterial only affect the (unused) return
  value. Now correctly calls failure() only when failIfNoMaterial is true,
  and success() otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Bug: Pickup pickaxe error

1 participant